package yf.mall.controller.api;

import com.yf.annotation.IgnoreAuth;
import com.yf.annotation.LoginUserId;
import com.yf.response.R;
import lombok.Data;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/test")
public class ApiTestController {

    @GetMapping("/get")
    public R getTest(@LoginUserId Long userId, String name, String pwd){
        return R.ok("get 1"+userId);
    }

    @PostMapping("/post")
    @IgnoreAuth
    public R postTest(String name,String pwd){
        return R.ok("post 1");
    }

    @PostMapping("/post/json")
    @IgnoreAuth
    public R postTestJson(@RequestBody TestVo testVo){
        return R.ok("json 1");
    }

    @Data
    public static class TestVo{
        private String name;

        private String pwd;
    }

}
